home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
awe2-0_1.lha
/
awe2-0.1
/
Src
/
RCS
/
OwnedFacility.h,v
< prev
next >
Wrap
Text File
|
1989-02-23
|
2KB
|
110 lines
head 3.2;
branch ;
access ;
symbols ;
locks grunwald:3.2; strict;
comment @ * @;
3.2
date 89.02.20.15.36.28; author grunwald; state Exp;
branches ;
next 3.1;
3.1
date 88.12.20.13.50.09; author grunwald; state Exp;
branches ;
next 1.1;
1.1
date 88.10.30.13.05.59; author grunwald; state Exp;
branches ;
next ;
desc
@@
3.2
log
@Start using Gnu library heaps for schedulers
@
text
@// This may look like C code, but it is really -*- C++ -*-
//
// Copyright (C) 1988 University of Illinois, Urbana, Illinois
//
// written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
//
#ifndef OWNEDFACILITYH
#define OWNEDFACILITYH
//
// OwnedFacility.
//
// This models a simulation facility. A facility is composed of multiple
// servers. Servers are utilized for a period of time. The fraction of
// use of all servers over the total time the facility has existed
// (or since it was reset) determines the utilization of the facility.
//
#include "Semaphore.h"
#include "Facility.h"
class Thread;
class ThreadContainer;
typedef Thread *OwnedFacilityKey;
class OwnedFacility : public Facility {
struct {
OwnedFacilityKey single;
OwnedFacilityKey *many;
} beingServiced;
virtual void reportErrorState(ostream&);
void commonReserve(double, OwnedFacilityKey xkey);
public :
OwnedFacility(int servers = 1, ThreadContainer *scheduler =0);
~OwnedFacility();
virtual void reserve();
virtual void release();
virtual bool reserveNoBlock();
virtual void reserveKeyed(OwnedFacilityKey xkey);
virtual void releaseKeyed(OwnedFacilityKey xkey);
virtual bool isEmpty();
virtual unsigned queueLength();
virtual unsigned activeServers();
virtual unsigned size();
virtual void classPrintOn(ostream& s);
};
#endif OWNEDFACILITYH
@
3.1
log
@Steay version
@
text
@@
1.1
log
@Initial revision
@
text
@@